package com.diandian.backend.dingding.data.domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.util.Date;

public class DingdingStaffSalaryOpenApi {

	private Long id;
	/**
	 * 工资部分
	 */
	private String postWage;
	private String basicSalary;
	private String monthPerformanceSalaryStandard;
	private String monthPerformanceScore;
	private String monthPerformanceCoefficient;
	private String monthPerformanceSalary;
	private String otherSalary;
	private String beforeTaxDeductionTotal;
	private String salariesPayable;
	private String rewardXinghuoJlb;
	private String rewardXinghuoMzc;
	private String rewardXinghuoYl;
	private String rewardXinghuoFh;
	private String rewardXinghuoHpnk;
	private String rewardXinghuoBym;
	private String rewardXinghuoDz;
	private String rewardXinghuoXk;
	private String rewardXinghuoFnzt;
	private String rewardXinghuoYypzt;
	private String rewardXinghuoXhlyxm;
	private String rewardPkNf;
	private String rewardPkRy;
	private String rewardPkSp;
	private String rewardPkYyp;
	private String rewardPkFn;
	private String rewardPkWjcc;
	private String rewardPkHj;
	private String dividend;
	private String rewardDeduction;
	private String rewardTotal;
	private String salaryTotal;
	private String salarySchedule;
	private String salaryTitle;
	/**
	 * 人员信息部分
	 */
	private String userId;
	private String name;
	private String jobNumber;
	private String title;
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date hiredDate;
	private String seniority; // 工龄
	/**
	 * 部分信息
	 */
	private String deptCode;
	private String deptName;
	/**
	 * 部门扩展信息
	 */
	private String level;
	/**
	 * 员工扩展信息
	 */
	private String star;
	private String xinghuoTier;
	private String recommendBrand;
	private String status;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPostWage() {
		return postWage;
	}

	public void setPostWage(String postWage) {
		this.postWage = postWage;
	}

	public String getBasicSalary() {
		return basicSalary;
	}

	public void setBasicSalary(String basicSalary) {
		this.basicSalary = basicSalary;
	}

	public String getMonthPerformanceSalaryStandard() {
		return monthPerformanceSalaryStandard;
	}

	public void setMonthPerformanceSalaryStandard(String monthPerformanceSalaryStandard) {
		this.monthPerformanceSalaryStandard = monthPerformanceSalaryStandard;
	}

	public String getMonthPerformanceScore() {
		return monthPerformanceScore;
	}

	public void setMonthPerformanceScore(String monthPerformanceScore) {
		this.monthPerformanceScore = monthPerformanceScore;
	}

	public String getMonthPerformanceCoefficient() {
		return monthPerformanceCoefficient;
	}

	public void setMonthPerformanceCoefficient(String monthPerformanceCoefficient) {
		this.monthPerformanceCoefficient = monthPerformanceCoefficient;
	}

	public String getMonthPerformanceSalary() {
		return monthPerformanceSalary;
	}

	public void setMonthPerformanceSalary(String monthPerformanceSalary) {
		this.monthPerformanceSalary = monthPerformanceSalary;
	}

	public String getOtherSalary() {
		return otherSalary;
	}

	public void setOtherSalary(String otherSalary) {
		this.otherSalary = otherSalary;
	}

	public String getBeforeTaxDeductionTotal() {
		return beforeTaxDeductionTotal;
	}

	public void setBeforeTaxDeductionTotal(String beforeTaxDeductionTotal) {
		this.beforeTaxDeductionTotal = beforeTaxDeductionTotal;
	}

	public String getSalariesPayable() {
		return salariesPayable;
	}

	public void setSalariesPayable(String salariesPayable) {
		this.salariesPayable = salariesPayable;
	}

	public String getRewardXinghuoJlb() {
		return rewardXinghuoJlb;
	}

	public void setRewardXinghuoJlb(String rewardXinghuoJlb) {
		this.rewardXinghuoJlb = rewardXinghuoJlb;
	}

	public String getRewardXinghuoMzc() {
		return rewardXinghuoMzc;
	}

	public void setRewardXinghuoMzc(String rewardXinghuoMzc) {
		this.rewardXinghuoMzc = rewardXinghuoMzc;
	}

	public String getRewardXinghuoYl() {
		return rewardXinghuoYl;
	}

	public void setRewardXinghuoYl(String rewardXinghuoYl) {
		this.rewardXinghuoYl = rewardXinghuoYl;
	}

	public String getRewardXinghuoFh() {
		return rewardXinghuoFh;
	}

	public void setRewardXinghuoFh(String rewardXinghuoFh) {
		this.rewardXinghuoFh = rewardXinghuoFh;
	}

	public String getRewardXinghuoHpnk() {
		return rewardXinghuoHpnk;
	}

	public void setRewardXinghuoHpnk(String rewardXinghuoHpnk) {
		this.rewardXinghuoHpnk = rewardXinghuoHpnk;
	}

	public String getRewardXinghuoBym() {
		return rewardXinghuoBym;
	}

	public void setRewardXinghuoBym(String rewardXinghuoBym) {
		this.rewardXinghuoBym = rewardXinghuoBym;
	}

	public String getRewardXinghuoDz() {
		return rewardXinghuoDz;
	}

	public void setRewardXinghuoDz(String rewardXinghuoDz) {
		this.rewardXinghuoDz = rewardXinghuoDz;
	}

	public String getRewardXinghuoXk() {
		return rewardXinghuoXk;
	}

	public void setRewardXinghuoXk(String rewardXinghuoXk) {
		this.rewardXinghuoXk = rewardXinghuoXk;
	}

	public String getRewardXinghuoFnzt() {
		return rewardXinghuoFnzt;
	}

	public void setRewardXinghuoFnzt(String rewardXinghuoFnzt) {
		this.rewardXinghuoFnzt = rewardXinghuoFnzt;
	}

	public String getRewardXinghuoYypzt() {
		return rewardXinghuoYypzt;
	}

	public void setRewardXinghuoYypzt(String rewardXinghuoYypzt) {
		this.rewardXinghuoYypzt = rewardXinghuoYypzt;
	}

	public String getRewardXinghuoXhlyxm() {
		return rewardXinghuoXhlyxm;
	}

	public void setRewardXinghuoXhlyxm(String rewardXinghuoXhlyxm) {
		this.rewardXinghuoXhlyxm = rewardXinghuoXhlyxm;
	}

	public String getRewardPkNf() {
		return rewardPkNf;
	}

	public void setRewardPkNf(String rewardPkNf) {
		this.rewardPkNf = rewardPkNf;
	}

	public String getRewardPkRy() {
		return rewardPkRy;
	}

	public void setRewardPkRy(String rewardPkRy) {
		this.rewardPkRy = rewardPkRy;
	}

	public String getRewardPkSp() {
		return rewardPkSp;
	}

	public void setRewardPkSp(String rewardPkSp) {
		this.rewardPkSp = rewardPkSp;
	}

	public String getRewardPkYyp() {
		return rewardPkYyp;
	}

	public void setRewardPkYyp(String rewardPkYyp) {
		this.rewardPkYyp = rewardPkYyp;
	}

	public String getRewardPkFn() {
		return rewardPkFn;
	}

	public void setRewardPkFn(String rewardPkFn) {
		this.rewardPkFn = rewardPkFn;
	}

	public String getRewardPkHj() {
		return rewardPkHj;
	}

	public void setRewardPkHj(String rewardPkHj) {
		this.rewardPkHj = rewardPkHj;
	}

	public String getDividend() {
		return dividend;
	}

	public void setDividend(String dividend) {
		this.dividend = dividend;
	}

	public String getRewardTotal() {
		return rewardTotal;
	}

	public void setRewardTotal(String rewardTotal) {
		this.rewardTotal = rewardTotal;
	}

	public String getSalaryTotal() {
		return salaryTotal;
	}

	public void setSalaryTotal(String salaryTotal) {
		this.salaryTotal = salaryTotal;
	}

	public String getSalarySchedule() {
		return salarySchedule;
	}

	public void setSalarySchedule(String salarySchedule) {
		this.salarySchedule = salarySchedule;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getJobNumber() {
		return jobNumber;
	}

	public void setJobNumber(String jobNumber) {
		this.jobNumber = jobNumber;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getHiredDate() {
		return hiredDate;
	}

	public void setHiredDate(Date hiredDate) {
		this.hiredDate = hiredDate;
	}

	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getStar() {
		return star;
	}

	public void setStar(String star) {
		this.star = star;
	}

	public String getXinghuoTier() {
		return xinghuoTier;
	}

	public void setXinghuoTier(String xinghuoTier) {
		this.xinghuoTier = xinghuoTier;
	}

	public String getRecommendBrand() {
		return recommendBrand;
	}

	public void setRecommendBrand(String recommendBrand) {
		this.recommendBrand = recommendBrand;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSeniority() {
		if(this.hiredDate != null && this.hiredDate.before(new Date())) {
			LocalDate currentDate = LocalDate.now();
			Period period = Period.between(this.hiredDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), currentDate);
			int yearsOfService = period.getYears();
			int monthsOfService = period.getMonths();
			int daysOfService = period.getDays();

			String result = "";
			if(yearsOfService > 0) {
				result = result + yearsOfService + "年";
			}
			if(monthsOfService > 0) {
				result = result + monthsOfService + "月";
			}
			if(daysOfService > 0) {
				result = result + daysOfService + "天";
			}
			return result;
		}
		return null;
	}

	public void setSeniority(String seniority) {
		this.seniority = seniority;
	}

	public String getRewardPkWjcc() {
		return rewardPkWjcc;
	}

	public void setRewardPkWjcc(String rewardPkWjcc) {
		this.rewardPkWjcc = rewardPkWjcc;
	}

	public String getRewardDeduction() {
		return rewardDeduction;
	}

	public void setRewardDeduction(String rewardDeduction) {
		this.rewardDeduction = rewardDeduction;
	}

	public String getSalaryTitle() {
		return salaryTitle;
	}

	public void setSalaryTitle(String salaryTitle) {
		this.salaryTitle = salaryTitle;
	}
}
